using Microsoft.AspNetCore.Mvc;
using StudentWeb.BLL;
using StudentWeb.Model;
using IResult = StudentWeb.BLL.IResult;

namespace StudentWeb.Controllers
{
    /// <summary>
   
    /// </summary>
    [ApiController]
    [Route("[controller]/[action]")]
    public class WYUserController(WYUserBO wyUserBO) : ControllerBase
    {
        #region 分页与查询
        [HttpPost]
        public IResult PagedList(PagedListReq model)
        {
            return wyUserBO.PagedList(model.pageIndex, model.pageSize, model.condition);
        }
        #endregion

        #region 单条记录查询
        [HttpGet]
        public IResult GetInfo(int wYUserID)
        {
            return wyUserBO.GetInfo(wYUserID);
        }
        #endregion

        #region 添加单条记录
        [HttpPost]
        public IResult Insert(WYUserInfoParam model)
        {
            if (model == null) return Result.Fail();
            return wyUserBO.Insert(model);
        }
        #endregion

        #region 修改单条记录
        [HttpPut]
        public IResult Update(WYUserInfoParam model)
        {
            if (model == null) return Result.Fail();
            return wyUserBO.Update(model);
        }
        #endregion

        #region 删除单条记录
        [HttpDelete]
        public IResult Delete(int wYUserID)
        {
            return wyUserBO.Delete(wYUserID);
        }
        #endregion
    }
}



